﻿#ifndef MEASUREPARALLELLINESA_H
#define MEASUREPARALLELLINESA_H

#include "MeasureElement.h"
namespace Qly {

class MeasureDataSet;

/**
 * @brief The MeasureLineWidthSA class 半自动测量平行线的间距
 */

class MeasureLineWidthSA : public MeasureElement
{
public:
    MeasureLineWidthSA(MeasureDataSet *parent = nullptr);

    friend MeasureDataSet;
    QString name() Q_DECL_OVERRIDE {return u8"平行线间距离";}

    void adjust(QPointF start_pix, QPointF end_pix, double width_pix);

private:
    void computeLengthSlope( void );
    int mouseLButtonPress(QPointF point_pix, QPointF point_um) Q_DECL_OVERRIDE;
    int mouseMove(QPointF point_pix, QPointF point_um) Q_DECL_OVERRIDE;
    void compute(void) Q_DECL_OVERRIDE; //计算图元的位置，还有长度结果
    void updateText(bool updatePosition = true) Q_DECL_OVERRIDE;
    void paint( QPainter &painter ) Q_DECL_OVERRIDE; //画方法

    int m_searchWidth = 60;
    double m_cos_theta; // 拉的直线的角度
    double m_sin_theta;
    double m_angle;
    double m_length_pix;// 拉的直线的长度，这个变量是有用的。最后平行线的长度也是这么长
    double m_length_um;
};
}



#endif // MEASUREPARALLELLINESA_H
